import Vue from 'vue'

const app = new Vue({
    el: '#root',
    template: '<div>{{text}}</div>',
    data: {
        text: 'aaa'
    },
    // 跟数据相关可以放到created中 得不到$el
    beforeCreate () {
        console.log('this is beforeCreate')
    },
    created(){
        console.log('this is Created')
    },
    // 跟dom相关的需要放到mounted中
    beforeMount(){
        console.log('this is beforeMount')
    },
    // render function会在，beforeMount和mounted之间调用，
    mounted(){
        console.log('this is mounted')
    },
    beforeUpdate(){
        console.log('this is beforeUpdate')
    },
    updated(){
        console.log('this is updated')
    },
    activated(){
        console.log('this is activated')
    },
    deactivated(){
        console.log('this is deactivated')
    },
    beforeDestroy(){
        console.log('this is beforeDestroy')
    },
    destroyed(){
        console.log('this is destroyed')
    }
})

app.$data.text = 32
app.$destroy()